package service

import (
	"context"
	"projectbao/pb"
)

var ProductService = &productService{}

type productService struct {
	pb.UnimplementedProductServiceServer
}

func (p *productService) GetProductStock(context context.Context, request *pb.ProductRequest) (*pb.ProductResponse, error) {
	stock := p.GetStockById(request.ProdId)
	return &pb.ProductResponse{ProdStock: stock}, nil
}

func (p *productService) GetStockById(id int32) int32 {
	return id
}
